package com.maybach.workflow.core.config.parser;


import com.maybach.workflow.common.api.node.BaseNode;
import com.maybach.workflow.common.api.node.StartNode;
import org.w3c.dom.Element;

/**
 * Created by well on 15/6/12.
 */
public class StartParser implements Parser{

    public String nodeName = NodeParser.NODE_NAME_START;


    @Override
    public BaseNode parse(Element element) {
        if(element == null){
            return null;
        }
        if(!nodeName.equalsIgnoreCase(element.getNodeName())){
            return null;
        }
        StartNode startNode = new StartNode();

        startNode.setName(element.getAttribute(NodeParser.ATTR_NAME));
        startNode.setTo(element.getAttribute(NodeParser.ATTR_TO));
        check(startNode);
        return startNode;
    }

    public void check(StartNode startNode){

    }
}
